home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
Updates
/
HD-Installer
/
-WHDLoad-
/
WHDLoad_dev
/
Patcher1.04
/
Patcher15.ASM
< prev
next >
Wrap
Assembly Source File
|
2000-05-08
|
59KB
|
3,281 lines
;V1.04 ERRORMESSAGE IF PATCH WAS CLICKED WITH NO PARAMETER SELECTED
;V1.03 VERSIONSTRING ADDED, CRC16-EVALROUTINE ADDED
;V1.02 FSSM-DEVICEPOINTER STORED, ADDED DRIVEINHIBIT-OPTION
;V1.01 COMMANDLINEPARAMETER ADDED
;V1.00 INITIAL REVISION
INCDIR ASM-ONE:INCLUDE2.0/
INCLUDE LIBRARIES/DOS_LIB.I
INCLUDE LIBRARIES/FILEHANDLER.I
INCLUDE LIBRARIES/DOSEXTENS.I
INCLUDE LIBRARIES/DISKFONT_LIB.I
INCLUDE EXEC/EXEC_LIB.I
INCLUDE EXEC/MEMORY.I
INCLUDE GRAPHICS/GRAPHICS_LIB.I
INCLUDE INTUITION/INTUITION_LIB.I
INCLUDE INTUITION/INTUITION.I
INCLUDE DEVICES/TRACKDISK.I
INCLUDE EXEC/IO.I
;_SYSBASE EQU 4
INCDIR ASM-ONE:OWN/Patcher/
;VERSION=1
;SUBVERSION=4
debug=0
FlaggenTEMP = activate!WINDOWDRAG!WINDOWCLOSE ;!REPORTMOUSE
FLAGGEN = FLAGGENTEMP!WBENCHWINDOW!WINDOWDEPTH!GIMMEZEROZERO
ICDMPFLTEMP = GADGETUP!ACTIVEWINDOW ;!MOUSEBUTTONS
ICDMPFL = ICDMPFLTEMP!INACTIVEWINDOW!CLOSEWINDOW
JAM2 = 1
;MODE_READWRITE = $3ED
;patcher-includefile for V1.03
PCH_FILECOUNT = $80004450
PCH_ADAPTOR = $80004451
PCH_DISKNAME = $80004452
PCH_CHECKDISK = $80004453
PCH_FILENAME = $80004454
PCH_SPECIAL = $80004455
PCH_CHANGES = $80004456
PCH_PROCESSING = $80004457
PCH_NAME = $80004458
PCH_MINVERSION = $80004459
PCH_LOADOFFSET = $8000445A
PCH_INIT = $8000445B
PCH_STATE = $8000445C
PCH_STATE2 = $8000445D
PCH_APPENDSPACE = $8000445E
PCH_SAVEDATA = $8000445F
PCH_DATALENGTH = $80004460
PCH_BOOTBLOCK = $80004461
PCH_FINISH = $80004462
PCH_ERRORINPARAMETER = $80004463
PCH_SAVEPGM = $80004464
PTB_DOSBASE = $0
PTB_ADDRESSOFFILE = $4
PTB_INTUITIONBASE = $8
PTB_GFXBASE = $C
PTB_WINDOW = $10
PTB_FILENAME = $14
PTB_FULLNAME = $18
PTB_FILESIZE = $1C
PTB_DISKNAME = $20
PTB_OPENDEVICE = $24
PTB_DEVICESOURCEPTR = $28
PTB_DEVICEDESTPTR = $2C
PTB_SPACE = $30
PTB_FORMATDEST = $34
PTB_REQUEST = $38
;--- new since version 1.02 ---
PTB_FSSMSOURCEPTR = $3C
PTB_FSSMDESTPTR = $40
PTB_INHIBITDRIVE = $44
PTB_ENABLEDRIVE = $48
;--- new since version 1.03 ---
PTB_CRC16 = $4C
SECTION Editor,CODE
BRA.S HP
DC.B 0,'$VER: Patcher 1.04 (17-jun-97 2:00:00)',0
EVEN
HP
BASEREG DOSBAS,A5
LEA.L DOSBAS(PC),A5
MOVE.L A7,OSSTACK(A5)
ifne debug
lea .line(PC),a0
bra.s .contdb
.line dc.b '-sdf2: -pasm-one:own/patcher/parameter/imagerrocknroll',0
EVEN
.contdb
endc
BSR.W EXAMCL
MOVE.L (_SYSBASE).W,A6
LEA.L INTUINAME(PC),A1
MOVE.L #0,D0
JSR _LVOOpenLibrary(A6) ;Intuition öffnen
TST.L D0
BEQ.W ERR
MOVE.L D0,INTUIBASE(A5) ;Zeiger sichern
MOVE.L (_SYSBASE).W,A6
LEA.L DOSNAM(PC),A1
MOVEQ.L #0,D0
JSR _LVOOpenLibrary(A6) ;DOS öffnen
TST.L D0
BEQ.W ERR
MOVE.L D0,DOSBAS(A5) ;Zeiger sichern
MOVE.L (_SYSBASE).W,A6
LEA.L GRANAME(PC),A1
MOVEQ.L #0,D0
JSR _LVOOpenLibrary(A6) ;Graphic-Lib öffnen
TST.L D0
BEQ.W ERR
MOVE.L D0,GRABASE(A5) ;Zeiger sichern
MOVE.L (_SYSBASE).W,A6
LEA.L DISKFNTNAME(PC),A1
MOVEQ.L #0,D0
JSR _LVOOPENLIBRARY(A6) ;Diskfont-Lib öffnen
TST.L D0
BEQ.W ERR
MOVE.L D0,DISKFNTBASE(A5) ;Zeiger sichern
MOVE.L DISKFNTBASE(PC),A6
LEA.L RUBY_FNT(PC),A0
JSR _LVOOPENDISKFONT(A6)
TST.L D0
BEQ.W ERR
MOVE.L #$28,D0
MOVE.L #MEMF_PUBLIC!MEMF_CLEAR,D1
MOVE.L (_SYSBASE).W,A6
JSR _LVOALLOCMEM(A6)
TST.L D0
BEQ.W ERR
MOVE.L D0,MYPORT(A5)
MOVE.L #$38,D0
MOVE.L #MEMF_PUBLIC!MEMF_CLEAR,D1
MOVE.L (_SYSBASE).W,A6
JSR _LVOALLOCMEM(A6)
TST.L D0
BEQ.W ERR
MOVE.L D0,BOOTIORQ(A5)
MOVE.L #$38,D0
MOVE.L #MEMF_PUBLIC!MEMF_CLEAR,D1
MOVE.L (_SYSBASE).W,A6
JSR _LVOALLOCMEM(A6)
TST.L D0
BEQ.W ERR
MOVE.L D0,DESTIORQ(A5)
MOVE.L #$38,D0
MOVE.L #MEMF_PUBLIC!MEMF_CLEAR,D1
MOVE.L (_SYSBASE).W,A6
JSR _LVOALLOCMEM(A6)
TST.L D0
BEQ.W ERR
MOVE.L D0,SOURCEIORQ(A5)
MOVE.L #$48,D0
MOVE.L #MEMF_PUBLIC!MEMF_CLEAR,D1
MOVE.L (_SYSBASE).W,A6
JSR _LVOALLOCMEM(A6)
TST.L D0
BEQ.W ERR
MOVE.L D0,DOSPACKETS(A5)
MOVEQ.L #-1,D0
MOVE.L (_SYSBASE).W,A6
JSR _LVOALLOCSIGNAL(A6)
CMP.L #-1,D0
BEQ.W ERR
MOVE.L D0,SIGNALSTORE
MOVE.L MYPORT(PC),A4
MOVE.B D0,MP_SIGBIT(A4)
SUB.L A1,A1
MOVE.L (_SYSBASE).W,A6
JSR _LVOFINDTASK(A6)
MOVE.L D0,MP_SIGTASK(A4)
MOVE.B #PA_SIGNAL,MP_FLAGS(A4)
CLR.B LN_PRI(A4)
CLR.L LN_NAME(A4)
MOVE.B #NT_MSGPORT,LN_TYPE(A4)
MOVE.L A4,A1
JSR _LVOADDPORT(A6)
ST.B PORTOK(A5)
MOVE.L MYPORT(PC),A0
MOVE.L BOOTIORQ(PC),A1
MOVE.L A0,MN_REPLYPORT(A1)
MOVE.W #$20,MN_LENGTH(A1)
MOVE.B #NT_MESSAGE,LN_TYPE(A1)
MOVE.L DESTIORQ(PC),A1
MOVE.L A0,MN_REPLYPORT(A1)
MOVE.W #$20,MN_LENGTH(A1)
MOVE.B #NT_MESSAGE,LN_TYPE(A1)
MOVE.L SOURCEIORQ(PC),A1
MOVE.L A0,MN_REPLYPORT(A1)
MOVE.W #$20,MN_LENGTH(A1)
MOVE.B #NT_MESSAGE,LN_TYPE(A1)
MOVE.L DOSPACKETS(PC),A1
MOVE.L A0,MN_REPLYPORT(A1)
MOVE.W #$30,MN_LENGTH(A1)
MOVE.B #NT_MESSAGE,LN_TYPE(A1)
TST.B EXEC1PARAM
BEQ.W .ALLP
LEA.L MEMORYBASE(PC),A3
MOVE.L #PARAMFILENAM,D1 ;LOAD SINGLE PARAMETER (COMMAND-LINE-
MOVE.L DOSBAS(PC),A6 ; VERSION)
JSR _LVOLOADSEG(A6)
TST.L D0
BEQ.W .ENDP
LSL.L #2,D0
ADDQ.L #4,D0
MOVE.L D0,(A3)
MOVE.L D0,A0
CLR.L (A0)
CMP.L #'PTCH',8(A0)
BNE.S .SP8
MOVE.L 4(A0),A0
.SP31 CMP.L #PCH_MINVERSION,(A0)+
BEQ.S .SP30
ADDQ.L #4,A0
TST.L (A0)
BEQ.W .ENDP
BRA.S .SP31
.SP30 TST.L (A0)
BEQ.W .ENDP
MOVE.L (A0),A0
CMP.B #'V',(A0)+
BNE.W ERR
MOVEQ.L #0,D1 ;MAINVERSIONCHECK
.SPV1 MOVE.B (A0)+,D0
BEQ.W ERR
AND.W #$F,D0
LSL.W #4,D1
OR.W D0,D1
CMP.B #'.',(A0)
BNE.S .SPV1
CMP.W #1,D1 ;VERSION-#
BHI.S .SP8
ADDQ.L #1,A0 ;SKIP '.'
MOVEQ.L #0,D1
MOVE.B (A0)+,D0
BEQ.W ERR
AND.W #$F,D0
LSL.W #4,D1
OR.W D0,D1
MOVE.B (A0)+,D0
BEQ.W ERR
AND.W #$F,D0
LSL.W #4,D1
OR.W D0,D1
CMP.W #4,D1 ;SUBVERSION-#
BHI.S .SP8
BRA.W .ENDP
.SP8 LEA.L MEMORYBASE(PC),A3
.SP7 MOVE.L (A3),A2
TST.L (A2)
BEQ.S .SP6
MOVE.L (A3),A3
BRA.S .SP7
.SP6 CLR.L (A3)
MOVE.L A2,D1
SUBQ.L #4,D1
LSR.L #2,D1
MOVE.L DOSBAS(PC),A6
JSR _LVOUNLOADSEG(A6)
BRA.W .ENDP
.ALLP LEA.L LOCKNAM(PC),A1 ;LOAD PARAMETERS
MOVE.L A1,D1
MOVE.L #MODE_READWRITE,D2
MOVE.L DOSBAS(PC),A6
JSR _LVOLOCK(A6)
TST.L D0
BEQ.W ERR
MOVE.L D0,PARAMLOCK(A5)
MOVE.L PARAMLOCK(PC),D1
MOVE.L #PARAMINFO,D2
MOVE.L DOSBAS(PC),A6
JSR _LVOEXAMINE(A6)
TST.L D0
BEQ.W ERR
BRA.S .1
.3 MOVE.L PARAMLOCK(PC),D1
MOVE.L #PARAMINFO,D2
MOVE.L DOSBAS(PC),A6
JSR _LVOEXNEXT(A6)
TST.L D0
BEQ.W .2
.1 LEA.L PARAMINFO,A0
CMP.L #-3,FIB_DIRENTRYTYPE(A0)
BNE.S .3
LEA.L MEMORYBASE(PC),A3
.5 TST.L (A3)
BEQ.S .4
MOVE.L (A3),A3
BRA.S .5
.4
LEA.L PARAMINFO,A0
LEA.L FIB_FILENAME(A0),A1
LEA.L BUFFILNAM(PC),A0
MOVEQ.L #$68-1,D0
.26 MOVE.B (A1)+,(A0)+
DBF D0,.26
MOVE.L #FILENAM,D1
MOVE.L DOSBAS(PC),A6
JSR _LVOLOADSEG(A6)
TST.L D0
BEQ.S .3
LSL.L #2,D0
ADDQ.L #4,D0
MOVE.L D0,(A3)
MOVE.L D0,A0
CLR.L (A0)
CMP.L #'PTCH',8(A0)
BNE.S .8
MOVE.L 4(A0),A0
.31 CMP.L #PCH_MINVERSION,(A0)+
BEQ.S .30
ADDQ.L #4,A0
TST.L (A0)
BEQ.W .3
BRA.S .31
.30 TST.L (A0)
BEQ.W .3
MOVE.L (A0),A0
CMP.B #'V',(A0)+
BNE.W ERR
MOVEQ.L #0,D1 ;MAINVERSIONCHECK
.APV1 MOVE.B (A0)+,D0
BEQ.W ERR
AND.W #$F,D0
LSL.W #4,D1
OR.W D0,D1
CMP.B #'.',(A0)
BNE.S .APV1
CMP.W #1,D1 ;VERSION-#
BHI.S .8
ADDQ.L #1,A0 ;SKIP '.'
MOVEQ.L #0,D1
MOVE.B (A0)+,D0
BEQ.W ERR
AND.W #$F,D0
LSL.W #4,D1
OR.W D0,D1
MOVE.B (A0)+,D0
BEQ.W ERR
AND.W #$F,D0
LSL.W #4,D1
OR.W D0,D1
CMP.W #4,D1 ;SUBVERSION-#
BHI.S .8
BRA.W .3
.8 LEA.L MEMORYBASE(PC),A3
.7 MOVE.L (A3),A2
TST.L (A2)
BEQ.S .6
MOVE.L (A3),A3
BRA.S .7
.6 CLR.L (A3)
MOVE.L A2,D1
SUBQ.L #4,D1
LSR.L #2,D1
MOVE.L DOSBAS(PC),A6
JSR _LVOUNLOADSEG(A6)
BRA.W .3
.2 MOVE.L PARAMLOCK(PC),D1
MOVE.L DOSBAS(PC),A6
JSR _LVOUNLOCK(A6)
CLR.L PARAMLOCK ;END OF LOADING PARAMETERS
.ENDP LEA.L MEMORYBASE(PC),A3
TST.L (A3)
BEQ.W ERR
MOVEQ.L #0,D0
.10 MOVE.L (A3),A3
ADDQ.W #1,D0
TST.L (A3)
BNE.S .10
MOVE.W D0,PARAMCOUNT
TST.W PARAMCOUNT
BEQ.W ERR
MOVE.L #$FFFF,D0
MOVEQ.L #0,D1
MOVE.W PARAMCOUNT,D1
CMP.W #5,D1
BLS.S .PI1
MULU.W #5,D0
DIVU.W D1,D0
BRA.S .11
.PI1 MOVE.L #$FFFF,D0
.11 LEA.L PROPINFO1(PC),A0
MOVE.W D0,PI_VERTBODY(A0)
MOVE.W D0,LENGTHBODY
MOVE.W PARAMCOUNT(PC),D1
SUBQ.W #1,D1
.27 LEA.L MEMORYBASE(PC),A4
MOVE.W PARAMCOUNT(PC),D0
SUBQ.W #1,D0
.15 DBF D0,.13
DBF D1,.27
BRA.S .14
.13
.16 MOVE.L (A4),A3
TST.L (A3)
BEQ.S .15
MOVE.L $4(A3),A1
.18 CMP.L #PCH_NAME,(A1)+
BEQ.S .17
ADDQ.L #4,A1
TST